<?php
//同步数据到另一个数据库
//翻译数据在另外一步执行
include_once("../config.php");
$host = $_SERVER['HTTP_HOST']; //取得进入所输入的域名
$theme_folder = host_theme($host);
include_once '../front/' . $theme_folder . '/connection.php';
?>




<?php

//搜索所有的产品的model，model就是分类。
$detaillist=select_lines_items($table_prefix."detail","","nid,introduce2","belong = 'product' ","0");
//搜索所有的分类
$termlist  =select_lines_items($table_prefix."term","","nid,name","belong = 'product'","");

$_termlist=transform_2darray_in_1darray_with_new_key($termlist,"name","nid");


//print_r2($_termlist);
//print_r2($detaillist);
//print_r2($termlist);
//做成新的数组，nid=》term——nid

foreach($detaillist as $k=>$v)
{

    $_datas['ai_detail_nid']=$v['nid'];
    $_datas['ai_term_nid']=$_termlist[$v['introduce2']];

    echo $insert_str=insert_date($table_prefix."relation",$_datas);
    $query = mysql_query($insert_str) or die (mysql_error().$insert_str);
    echo "<br/>";

}



//插入relation

?>


